﻿package com.alstudio.module.sns.weiboshare;

import wxapi.WeiXin;
import android.app.Activity;

import com.alstudio.app.ALLocalEnv;
import com.alstudio.module.sns.base.SnsConfig;
import com.alstudio.module.sns.sina.SinaWeibo;
import com.alstudio.module.sns.tencent.ITencent;

public final class ThirdPartFactory {
//	private static Facebook mFacebookInstance;
//	private static TwitterApp mTwitter;
	private static SinaWeibo mSinaWeibo;

	private static ITencent mTencentInstance;
	
	private static WeiXin mWeiXin;

//	public static Facebook getFacebookInstance() {
//		if (mFacebookInstance == null)
//			mFacebookInstance = new Facebook(App.FACEBOOK_APP_ID);
//
//		return mFacebookInstance;
//	}

//	public static TwitterApp getTwitterInstance() {
//		if (mTwitter == null)
//			mTwitter = new TwitterApp(App.TWITTER_CONSUMER_KEY,
//					App.TWITTER_SECRET_KEY);
//
//		return mTwitter;
//	}

	public static SinaWeibo getSinaWeiboInstance(Activity activity) {
//		if (mSinaWeibo == null)
			mSinaWeibo = new SinaWeibo(activity,SnsConfig.SINA_APP_KEY,
					SnsConfig.SINA_CALLBACK_URL);

		return mSinaWeibo;
	}

	public static ITencent getTencentInstance(Activity activity) {
//		if (mTencentInstance == null)
			mTencentInstance = new ITencent(activity,SnsConfig.TENCENT_APP_ID,
					SnsConfig.TENCENT_SCOPE);

		return mTencentInstance;
	}
	
	public static WeiXin getWeiXinInstance(){
		if(mWeiXin == null){
			mWeiXin = new WeiXin(ALLocalEnv.getLocalEnv().getApplicationContext(),SnsConfig.WEIXIN_APP_ID);
		}
		return mWeiXin;
	}

}
